home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DNet / DNetObject.h < prev    next >
Text File  |  1996-07-05  |  2KB  |  107 lines

  1. // DNetObject.h  
  2. // Base class for Internet objects
  3. // by D. Gilbert, Mar 1992
  4. // DClap version Jan 94, revised 1996
  5.  
  6. #ifndef __DNETOBJ__
  7. #define __DNETOBJ__
  8.         
  9.         
  10. #include <DObject.h>
  11. #include <DTCP.h>
  12. #include <DTask.h>
  13. #include <DTaskMaster.h>
  14. #include <Dvibrant.h>
  15.  
  16.  
  17.  
  18. class    DList;
  19. class DFile; 
  20. class DView; 
  21.  
  22.  
  23. class DNetOb : public DTaskMaster {
  24. public:
  25.  
  26.     enum  TCPprotocols {
  27.         kUnknownProt = 0,
  28.         kUnsupportedProt,
  29.         kSMTPprot,
  30.         kGopherprot,
  31.         kHTTPprot,
  32.         kFileprot,  
  33.         kFTPprot,
  34.         kTelnetprot,
  35.         kTN3270prot,
  36.         kWhoisprot,
  37.         kFingerprot,
  38.         kPOPprot,
  39.         kBOPprot,
  40.         kNNTPprot,
  41.         kWAISprot
  42.         };
  43.  
  44.         // basic object info
  45.     short            fProtocol;        // kGopher, kFTP, kHTTP, kSMTP, kETC
  46.     long             fType;                 // type of object 
  47.     char*            fName;                 
  48.     char*            fPath;             
  49.     char*            fHost;                 
  50.     long            fPort;                 // Port number on host   
  51.     char*            fURL;                    //
  52.     char*            fUser;             
  53.     char*            fPass;             
  54.     Boolean        fIsLocal;            // for type file:///
  55.  
  56.         // internal data
  57.     char*            fInfo;                    // data read from service 
  58.     long            fInfoSize;            // can't use strlen for binary data @!
  59.     char            *fQuery;                // alternate query data ptr, temp
  60.     char            *fQueryGiven;
  61.     Boolean        fDeleted;
  62.  
  63.  
  64.     DNetOb();
  65.     DNetOb( DNetOb* anet);
  66.     virtual ~DNetOb();
  67.     virtual    Boolean suicide(void);   
  68.     virtual    Boolean suicide(short ownercount);
  69.     
  70.     static short StandardPort( short protocol);
  71.     static const char* GetProtoName( short listitem);
  72.     static char  GetProtoVal( short listitem);
  73.     static short GetProtoItem( char theProto);
  74.     static Boolean  GetProtoSupport( short listitem);
  75.  
  76.     virtual    void Initialize();
  77.     virtual void Copy( DNetOb* anet); 
  78.     virtual DObject* Clone();    // override
  79.     virtual void DeleteInfo();
  80.     Boolean Equals(DNetOb* other);
  81.     Boolean operator ==(DNetOb* other);
  82.     
  83.     virtual const char* ShortName();  
  84.     virtual const char* GetName();
  85.     virtual const char* GetPath();
  86.     virtual const char* GetHost();
  87.     virtual const char* GetPort();
  88.     virtual const char* GetUser();
  89.     virtual const char* GetPass();
  90.     virtual const char* GetProtocol();
  91.     virtual const char* GetURL();
  92.     virtual const char* GetKindName();
  93.  
  94.     virtual void StoreName(char* aStr);
  95.     virtual void StorePath(char* aStr);
  96.     virtual void StoreHost(char* aStr);
  97.     virtual void StoreUser(char* aStr);
  98.     virtual void StorePass(char* aStr);
  99.     virtual void StorePort(char* aStr);
  100.     virtual void StoreProtocol( short protocol);
  101.     virtual void StoreURL(char *plus);
  102.         
  103. };
  104.  
  105. #endif
  106.  
  107.